home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / mach / amiga / tools / parsrtls.lha / bison_flex / bison.doc next >
Encoding:
Text File  |  1992-09-09  |  5.9 KB  |  199 lines

  1.  
  2.  
  3.  
  4. BISON(1)                 USER COMMANDS                   BISON(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      bison - GNU Project parser generator (yacc replacement)
  10.  
  11. SYNOPSIS
  12.      bison [ -b _f_i_l_e-_p_r_e_f_i_x ] [ --file-prefix=_f_i_l_e-_p_r_e_f_i_x ] [  -d
  13.      ]  [  --defines  ]  [  -l  ] [ --no-lines ] [ -o _o_u_t_f_i_l_e ] [
  14.      --output-file=_o_u_t_f_i_l_e ] [ -p _p_r_e_f_i_x ] [ --name-prefix=_p_r_e_f_i_x
  15.      ] [ -t ] [ --debug ] [ -v ] [ --verbose ] [ -V ] [ --version
  16.      ] [ -y ] [ --yacc ] [ --fixed-output-files ] file
  17.  
  18. DESCRIPTION
  19.      _B_i_s_o_n is a parser generator in the  style  of  _y_a_c_c(1).   It
  20.      should  be upwardly compatible with input files designed for
  21.      _y_a_c_c.
  22.  
  23.      Input files should follow the _y_a_c_c convention of  ending  in
  24.      .y.   Unlike  _y_a_c_c,  the  generated  files do not have fixed
  25.      names, but instead use the prefix of the  input  file.   For
  26.      instance,  a  grammar  description  file named parse.y would
  27.      produce the generated parser in a  file  named  parse.tab.c,
  28.      instead of _y_a_c_c's y.tab.c.
  29.  
  30.      This description of the options that can be given  to  _b_i_s_o_n
  31.      is  adapted  from  the  node Invocation in the bison.texinfo
  32.      manual, which should be taken as authoritative.
  33.  
  34.      _B_i_s_o_n supports both traditional  single-letter  options  and
  35.      mnemonic long option names.  Long option names are indicated
  36.      with -- instead of -.  Abbreviations for  option  names  are
  37.      allowed  as  long  as  they  are unique.  When a long option
  38.      takes an argument, like --file-prefix,  connect  the  option
  39.      name and the argument with =.
  40.  
  41.   OPTIONS
  42.      -b _f_i_l_e-_p_r_e_f_i_x
  43.      --file-prefix=_f_i_l_e-_p_r_e_f_i_x
  44.           Specify a prefix to  use  for  all  _b_i_s_o_n  output  file
  45.           names.   The names are chosen as if the input file were
  46.           named _f_i_l_e-_p_r_e_f_i_x.c.
  47.  
  48.      -d
  49.      --defines
  50.           Write an extra output file containing macro definitions
  51.           for the token type names defined in the grammar and the
  52.           semantic value type YYSTYPE, as well as  a  few  extern
  53.           variable declarations.
  54.  
  55.           If the parser output file is  named  _n_a_m_e.c  then  this
  56.           file is named _n_a_m_e.h.
  57.  
  58.           This output file is essential if you wish  to  put  the
  59.           definition  of yylex in a separate source file, because
  60.  
  61.  
  62.  
  63. Sun Release 4.1        Last change: local                       1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. BISON(1)                 USER COMMANDS                   BISON(1)
  71.  
  72.  
  73.  
  74.           yylex needs to be able to refer to token type codes and
  75.           the variable yylval.
  76.  
  77.      -l
  78.      --no-lines
  79.           Don't put any #line preprocessor commands in the parser
  80.           file.  Ordinarily _b_i_s_o_n puts them in the parser file so
  81.           that the C compiler and debuggers will associate errors
  82.           with  your  source file, the grammar file.  This option
  83.           causes them to associate errors with the  parser  file,
  84.           treating  it  an  independent  source  file  in its own
  85.           right.
  86.  
  87.      -o _o_u_t_f_i_l_e
  88.      --output-file=_o_u_t_f_i_l_e
  89.           Specify the name _o_u_t_f_i_l_e for the parser file.
  90.  
  91.           The other output files' names are constructed from _o_u_t_-
  92.           _f_i_l_e as described under the -v and -d switches.
  93.  
  94.      -p _p_r_e_f_i_x
  95.      --name-prefix=_p_r_e_f_i_x
  96.           Rename the external symbols used in the parser so  that
  97.           they start with _p_r_e_f_i_x instead of yy.  The precise list
  98.           of symbols renamed is yyparse, yylex, yyerror,  yylval,
  99.           yychar, and yydebug.
  100.  
  101.           For example, if you use -p c, the names become  cparse,
  102.           clex, and so on.
  103.  
  104.      -t
  105.      --debug
  106.           Output a definition  of  the  macro  YYDEBUG  into  the
  107.           parser  file, so that the debugging facilities are com-
  108.           piled.
  109.  
  110.      -v
  111.      --verbose
  112.           Write an extra output file containing verbose  descrip-
  113.           tions  of  the  parser states and what is done for each
  114.           type of look-ahead token in that state.
  115.  
  116.           This file also describes all the conflicts, both  those
  117.           resolved  by  operator  precedence  and  the unresolved
  118.           ones.
  119.  
  120.           The file's name is made by removing .tab.c or  .c  from
  121.           the   parser  output  file  name,  and  adding  .output
  122.           instead.
  123.  
  124.           Therefore, if the input file is foo.y, then the  parser
  125.           file is called foo.tab.c by default.  As a consequence,
  126.  
  127.  
  128.  
  129. Sun Release 4.1        Last change: local                       2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. BISON(1)                 USER COMMANDS                   BISON(1)
  137.  
  138.  
  139.  
  140.           the verbose output file is called foo.output.
  141.  
  142.      -V
  143.      --version
  144.           Print the version number of _b_i_s_o_n.
  145.  
  146.      -y
  147.      --yacc
  148.      --fixed-output-files
  149.           Equivalent to -o y.tab.c; the  parser  output  file  is
  150.           called  y.tab.c,  and  the  other  outputs  are  called
  151.           y.output and y.tab.h.  The purpose of this switch is to
  152.           imitate _y_a_c_c's output file name conventions.  Thus, the
  153.           following shell script can substitute for _y_a_c_c:
  154.  
  155.           bison -y $*
  156.  
  157.  
  158.      The long-named options can be introduced with `+' as well as
  159.      `--',  for compatibility with previous releases.  Eventually
  160.      support for `+' will be removed, because it is  incompatible
  161.      with the POSIX.2 standard.
  162.  
  163. FILES
  164.      /usr/local/lib/bison.simple   simple parser
  165.      /usr/local/lib/bison.hairy    complicated parser
  166.  
  167. SEE ALSO
  168.      _y_a_c_c(1)
  169.      The  _B_i_s_o_n  _R_e_f_e_r_e_n_c_e   _M_a_n_u_a_l,   included   as   the   file
  170.      bison.texinfo in the _b_i_s_o_n source distribution.
  171.  
  172. DIAGNOSTICS
  173.      ``Self explanatory.''
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. Sun Release 4.1        Last change: local                       3
  196.  
  197.  
  198.  
  199.